package com.thiswhyme.common.utils;

import org.apache.commons.lang3.StringUtils;

/**
 * @description: 字符工具类
 * @author: thiswhyme
 * @date: 2021/5/7
 */
public class CommonStringUtils {

    /**
     * 首字母转小写
     * @param str
     * @return
     */
    public static String toLowerCaseFirst(String str) {
        if(Character.isLowerCase(str.charAt(0))) {
            return str;
        } else {
            char[] chars = str.toCharArray();
            chars[0] = Character.toLowerCase(chars[0]);
            return String.valueOf(chars);
        }
    }

    /**
     * 检查指定的字符串列表是否不为空
     */
    public static boolean areNotEmpty(String... values) {
        boolean result = true;
        if (values == null || values.length == 0) {
            result = false;
        } else {
            for (String value : values) {
                result &= StringUtils.isNotEmpty(value);
            }
        }
        return result;
    }
}
